(function($){
	$.fn.blockSlide = function(settings){    
        settings = jQuery.extend({
        	speed : "normal",
			num : 4,
			timer : 1000,
			flowSpeed:300
    	}, settings);
		return this.each(function() {
			$.fn.blockSlide.scllor( $( this ), settings );
    	});
    };
	$.fn.blockSlide.scllor=function($this, settings){
		var index=0;
		$('<div id="flow"></div>').appendTo($this);
		var ul = $( "ul:eq(0)", $this );
		var imgScllor = $( "div:eq(0)>div", $this );
		var timerID;
		var li = ul.children();
	 
		$(li).hover(function(){
			if(MyTime){
				clearInterval(MyTime);
			}
			index  =  $(li).index(this);
			MyTime = setTimeout(function(){
				$(imgScllor).stop();
				ShowjQueryFlash(index);
			} , 400);

		}, function(){
			clearInterval(MyTime);
			MyTime = setInterval(function(){
				ShowjQueryFlash(index);
			
				index++;
				if(index==settings.num)
					index=0;
			} , settings.timer);
		});
		
	 	$(imgScllor).hover(function(){
			if(MyTime){
				clearInterval(MyTime);
			}
	 	},function(){
			MyTime = setInterval(function(){
				ShowjQueryFlash(index);
			
				index++;
				if(index==settings.num)
					index=0;
			} , settings.timer);
	 	});
		
		var MyTime = setInterval(function(){
			ShowjQueryFlash(index);
			
			index++;
			if(index==settings.num)
				index=0;
		} , settings.timer);
		var ShowjQueryFlash=function (i) {
			$(imgScllor).eq(i).animate({opacity: 1},settings.speed).css({"z-index": "1"}).siblings().animate({opacity: 0},settings.speed).css({"z-index": "0"});
			
			$(".banner").css({"background-image":"url(/Public/home/images/bannerbg0"+(i+1)+".png)"});
			
			$(".banner ul li img").css({"filter":"alpha(opacity=50)","-moz-opacity":"0.5","opacity":"0.5"});
			$(".banner ul li").eq(i).find('img').css({"filter":"alpha(opacity=100)","-moz-opacity":"1","opacity":"1"});
		}
	}
})(jQuery);